package com.gxa.luckin.cart.service;

import com.gxa.luckin.core.exception.BusinessException;
import com.gxa.luckin.core.pojo.CartItem;

import java.net.URISyntaxException;
import java.util.Map;

/**
 * @author: XHZ
 * @date: 16:49 2021/7/16
 */
public interface CartService {

    /**
     * 添加商品到购物车
     * @param skuId
     * @param num
     */
    void addGoodsToCart(Long userId, String skuId, Integer num) throws BusinessException, URISyntaxException;

    /**
     * 修改购物项数量
     * @param skuId
     * @param num
     */
    void updateCartItemNum(Long userId, String skuId, Integer num);

    /**
     * 移除购物项
     * @param skuId
     */
    void removeCartItem(Long userId, String skuId);

    /**
     * 清空购物车
     */
    void clearCart(Long userId);


    /**
     * 查询购物项
     *
     * @param skuId
     * @return
     */
    CartItem queryUserCartItem(Long userId, String skuId) throws BusinessException;

    /**
     * 查询购物车
     * @return
     */
    Map queryUserCart(Long userId);
}
